﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace RapidTestMapMaker
{
    public partial class LayerUserControl : UserControl
    {
        public MapLayer Layer
        {
            get { return Layer; }
            set
            {
                Layer = value;
                textBox1.Text = value.Name;
                checkBox2.Checked = value.IsWall;
                checkBox1.Checked = value.Visible;
            }
        }



        public LayerUserControl()
        {
            InitializeComponent();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            if (Layer == null) { return; }
            Layer.Name = textBox1.Text;
        }

        private void checkBox2_CheckedChanged(object sender, EventArgs e)
        {
            if (Layer == null) { return; }
            //Layer.IsWall = checkBox2.Checked;
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (Layer == null) { return; }
            Layer.Visible = checkBox1.Checked;
        }
    }
}
